package com.zhijian.warehouse.manage.dao;

import com.zhijian.warehouse.manage.entity.po.StoreStockRecord;
import com.zhijian.warehouse.manage.entity.vo.request.StoreStockRecordSearchVo;
import com.zhijian.warehouse.manage.entity.vo.response.StoreStockRecordVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StoreStockRecordMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StoreStockRecord record);

    int insertSelective(StoreStockRecord record);

    StoreStockRecord selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(StoreStockRecord record);

    int updateByPrimaryKey(StoreStockRecord record);

    /**
     * 查询总数
     *
     * @param storeStockRecordSearchVo
     * @return
     */
    int count(StoreStockRecordSearchVo storeStockRecordSearchVo);

    /**
     * 查询列表
     *
     * @param storeStockRecordSearchVo
     * @return
     */
    List<StoreStockRecordVo> selectList(StoreStockRecordSearchVo storeStockRecordSearchVo);

    /**
     * 查询单个
     *
     * @param storeStockRecordSearchVo
     * @return
     */
    StoreStockRecordVo selectOne(StoreStockRecordSearchVo storeStockRecordSearchVo);

    /**
     * 根据ID查询vo
     *
     * @param id
     * @return
     */
    StoreStockRecordVo selectVoById(Long id);

    /**
     * 批量删除
     *
     * @param idList
     * @return
     */
    void deleteByIdList(@Param("idList") List<Long> idList);

    /**
     * 动态删除
     *
     * @param storeStockRecordSearchVo
     * @return
     */
    void deleteByCondition(StoreStockRecordSearchVo storeStockRecordSearchVo);

    /**
     * 批量新增
     *
     * @param entities
     * @return
     */
    int insertBatch(@Param("entities") List<StoreStockRecord> entities);

    /**
     * 根据StockUserId查询列表
     *
     * @param stockUserId
     * @return
     */
    List<StoreStockRecordVo> selectListByStockUserId(Long stockUserId);

    /**
     * 根据WarehouseId查询列表
     *
     * @param warehouseId
     * @return
     */
    List<StoreStockRecordVo> selectListByWarehouseId(Long warehouseId);

    /**
     * 根据CreateUserId查询列表
     *
     * @param createUserId
     * @return
     */
    List<StoreStockRecordVo> selectListByCreateUserId(Long createUserId);

    /**
     * 根据UpdateUserId查询列表
     *
     * @param updateUserId
     * @return
     */
    List<StoreStockRecordVo> selectListByUpdateUserId(Long updateUserId);

    /**
     * 根据日期查询最大的单号
     *
     * @param day
     * @return
     */
    String selectMaxNumberByDay(String day);
}